// OptionsCaller.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include "OptionsCaller.h"
#include "todaycmn.h"


BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
    return TRUE;
}



extern "C" OPTIONSCALLER_API  bool RunOptionsDialog(LPWSTR dllPath, HWND parent)
{
	HINSTANCE pluginInstance = LoadLibrary(dllPath);
	if (!pluginInstance)
		return false;

	PFNCUSTOMOPTIONSDLGPROC optionsProc = (PFNCUSTOMOPTIONSDLGPROC)GetProcAddress(pluginInstance, (LPWSTR )ORDINAL_OPTIONSDIALOGPROC);
	if (!optionsProc)
		return false;

	DialogBox(pluginInstance, MAKEINTRESOURCE(IDD_TODAY_CUSTOM), parent, optionsProc);
	return true;
}
